<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
		<script src="../jstree/jquery.tree.min.js"></script>
		<script>
		$(document).ready(function () { 
			$("#tree_div").tree({
				data : { 
					type : "json",
					async : true,
					opts : {
						async : true,
						method : "POST",
						url : "../../trunk/?p=get_file_listing" // KFM LOCATION
					}
				},
				callback : { 
					'beforedata':function(node){
						var id=$(node).attr('id');
						if(!id)return {'d':'/'};
						return {'d':$(node).attr('id').replace(/^kfm2_node_/,'')};
					},
					'ondata':function(res){
						var data=[],i;
						for(i in res.files)data.push({'data':i,'attributes':{'id':'kfm2_node_'+res.d+'/'+i}});
						for(i in res.directories)data.push({'data':i,'state':'closed','attributes':{'id':'kfm2_node_'+res.d+'/'+i}});
						return data;
					}
				}
			});
		});
		</script>
	</head>
	<body>
		<div id="tree_div"></div>
	</body>
</html>
